
<@main.header title="test">
</@main.header>

<@main.body>
<h1>holle world ${test!}</h1><br/>
1 + 1 = 3? ${(1 != 1)?string("yes", "no")}
${base}
</@main.body>

<@main.footer>
<script>
    // var webSocketUrl = 'ws://' + window.location.host + '/websocket/webSocketTest';
    // var socket = new WebSocket(webSocketUrl);//打开webSocket
    var sockjsUrl = 'http://' + window.location.host + '/websocket/webSocketTest';
    var socket = new SockJS(sockjsUrl);//打开Sockjs

    socket.onopen = function () {//处理连接开启事件
        console.log(" Opening");
        say();
    }

    socket.onmessage = function (e) {
        console.log("Received message :", e.data);
        setTimeout(function () {
            say()
        }, 2000);
    };

    socket.onclose  = function () {
        console.log("Closing");
    };

    function say() {
        socket.send("帅哥");//sendMassage
    }
</script>
</@main.footer>